﻿@page "/detail/{id}" 
@inject IFavoriteStorage _favoriteStorage
@inject IMGStorage _mgStorage


@if (_isLoadingMg)
{
    <div>
        <Spinner></Spinner>
    </div>
}
else
{
    <h1 style="color: #0078d4">@_mg.Question</h1>
    <div class="shim-xl"></div>
    <h3>@_mg.Answer1 @_mg.Answer2</h3>
    <div class="shim-xl"></div>
    <h3>@_mg.Answer3 @_mg.Answer4</h3>

    <div class="shim-2xl"></div>
    @if (_isLoadingFavorite) {
     <div>
            <Spinner></Spinner>
        </div>
} else {
    <Toggle @bind-Value="_favorite.IsFavorite"
            OnText="已收藏"
            OffText="未收藏"
            OnValueChanged="_ => ValueChanged()">
    </Toggle>
}

}

